/*
 * Copyright 2012 Faculty of Informatics - Masaryk University.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package cz.muni.fi.pa165.creatures.services;

import cz.muni.fi.pa165.creatures.dto.web.FunctionDTO;
import cz.muni.fi.pa165.creatures.dto.web.PersonDTO;
import cz.muni.fi.pa165.creatures.dto.web.PersonFunctionDTO;
import java.util.List;

/**
 * This interface represent a contract to be implemented in order to operate
 * with the {@link cz.muni.fi.pa165.creatures.model.web.PersonFunction}.
 *
 * @author smikloso
 */
public interface PersonFunctionService {

    /**
     * Creates new person-function association.
     *
     * @param personFunction person function to create
     */
    void create(PersonFunctionDTO personFunction);

    /**
     * Remove a created person-function association. That actually means a
     * person will not have some function anymore.
     *
     * @param personFunction person function to remove
     */
    void remove(PersonFunctionDTO personFunction);

    /**
     * Checks if a {@code person} has some {@code function}.
     *
     * @param person person to check a function of
     * @param function function to be checked if a person has it
     * @return true if a {@code person} has that {@code function}, false
     * otherwise
     */
    boolean hasFunction(PersonDTO person, FunctionDTO function);

    /**
     * Gets all functions of some person with a name {@code name}.
     *
     * @param name name of a person to get a list of all functions of
     * @return list of all functions of a person with specified {@code name}.
     */
    List<FunctionDTO> getFunctions(String name);
}
